package com.hyx.api.mapper;

import com.hyx.api.domain.InquiryOrder;
import com.hyx.api.domain.bo.InquiryOrderBo;
import com.hyx.api.domain.vo.InquiryOrderVo;
import com.hyx.api.domain.vo.PcOperatorPerVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 询价订单Mapper接口
 *
 * @author ruoyi
 * @date 2023-10-17
 */
public interface InquiryOrderMapper extends BaseMapperPlus<InquiryOrder, InquiryOrderVo> {


    List<InquiryOrderVo> queryOrderBatchIds(@Param("ids") List<Long> ids);

    /**
     * 根据报价状态获取询价订单列表
     * 1：报价中
     * 2：已报价
     * 3：未报价
     *
     * @param offerStatus
     * @param userId       报价师传
     * @param recycleBusId 总账户传
     * @return
     */
    List<InquiryOrderVo> queryListForOfferStatus(@Param("offerStatus") Integer offerStatus,
                                                 @Param("userId") Long userId,
                                                 @Param("recycleBusId") Long recycleBusId);

    /**
     * 根据报价状态获取询价订单数量
     * 0：未报价
     * 1：已报价
     *
     * @param offerStatus
     * @param userId       报价师传
     * @param recycleBusId 总账户传
     * @return
     */
    Long queryCountForOfferStatus(@Param("offerStatus") Integer offerStatus,
                                  @Param("userId") Long userId,
                                  @Param("recycleBusId") Long recycleBusId);

    List<InquiryOrderVo> queryPageList(InquiryOrderBo bo);

    Integer queryInquiryCountForTimeShop(@Param("startTime") Date startTime,
                                         @Param("endTime") Date endTime,
                                         @Param("shopId") Long shopId,
                                         @Param("userId") Long userId,
                                         @Param("companyId") Long companyId);


    /**
     * 获取该用户的所有询价订单
     *
     * @param userId
     * @param status
     * @return
     */
    List<InquiryOrderVo> queryInquiryListByUser(@Param("userId") Long userId,
                                                @Param("shopId") Long shopId,
                                                @Param("companyId") Long companyId,
                                                @Param("status") Integer status);

    Long queryWaitOfferCountByCompany(@Param("recoverBusId") Long recoverBusId,
                                      @Param("beginDate") Date beginDate,
                                      @Param("endDate") Date endDate);

    /**
     * 根据时间和回收商获取该回收商合作的所有公司的询单量
     *
     * @param queTime
     * @return
     */
    Long queryRecycleInquiryCountByTimeBus(@Param("queTime") Date queTime);

    /**
     * 获取PC端统计-今日店员业绩
     *
     * @return
     */
    List<PcOperatorPerVo> queryPcOperatorPerList();
}

